package com.wen.factory;

import com.wen.factory.entity.BlackHuman;
import com.wen.factory.entity.Human;
import com.wen.factory.entity.WhiteHuman;
import com.wen.factory.entity.YelloHuman;

/**
 * 类型接口测试类
 */
public class FactoryTest {

    public static void main(String[] args) {
        HumanFactoryImpl humanFactory = new HumanFactoryImpl();
        System.out.println("女娲开始创建黄种人");
        Human human = humanFactory.getHuman(YelloHuman.class);
        human.getColor();
        human.say();
        System.out.println("女娲开始创建白人");
        Human whiteHuman = humanFactory.getHuman(WhiteHuman.class);
        whiteHuman.getColor();
        whiteHuman.say();
        System.out.println("女娲开始创建黑人");
        Human blackHuman = humanFactory.getHuman(BlackHuman.class);
        blackHuman.getColor();
        blackHuman.say();

    }
}
